'''
Created on 2010-10-18

@author: DouglasWin7
'''

import os
from accessor.distinction import distinction
from google.appengine.ext.webapp import template
from google.appengine.api import users
from google.appengine.ext import webapp


class PointPage(webapp.RequestHandler):
    def get(self):
        user = users.get_current_user()
        if user:
            template_values = {"distinctions": distinction.get_all_distinctions(),"name":user.nickname()}
            path = os.path.join(os.path.dirname(__file__),"point.xhtml")
            self.response.out.write(template.render(path,template_values))
        else:
            self.redirect(users.create_login_url(self.request.uri))